Conversation
- 스웨거 요청은 aop 제외 - 로그인 필요없는 요청(스웨거)에서 getCurrentUser() null 안전처리
|
Caution Review failedThe pull request is closed. WalkthroughThe aspect for API request logging was updated to safely retrieve the current user using runCatching, make user references nullable in logs, and skip logging for Swagger, API docs, and actuator endpoints by early-returning in the around advice. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Aspect as ApiRequestLogAspect
participant Controller
Client->>Aspect: HTTP Request
rect rgba(200,200,255,0.2)
Note over Aspect: Around advice entry
Aspect->>Aspect: Check URI prefix (/swagger, /v3/api-docs, /actuator)
alt Excluded endpoint
Aspect->>Controller: proceed()
Controller-->>Aspect: result
Aspect-->>Client: result
else Logged endpoint
Aspect->>Aspect: runCatching { AuthService().getCurrentUser() }
Note over Aspect: currentUser may be null
Aspect->>Aspect: Log "start" with currentUser?.id
Aspect->>Controller: proceed()
Controller-->>Aspect: result
Aspect->>Aspect: Log "end" with currentUser?.id
Aspect-->>Client: result
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Free 📒 Files selected for processing (1)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary by CodeRabbit
Bug Fixes
Chores